// /**
//  * Copyright © 2015 Magento. All rights reserved.
//  * See COPYING.txt for license details.
//  */

@autocomplete-background: @color-white;
@autocomplete-border: 1px solid @form-element-input__border-color;
@autocomplete-item-border: 1px solid @color-gray90;
@autocomplete-item-hover: @color-gray91;
@autocomplete-item-amount-color: @color-gray60;
@autocomplete__background-color: @color-white;

@autocomplete__border: 1px solid @form-element-input__border-color;
@autocomplete-item__border: 1px solid @color-gray90;
@autocomplete-item__hover__color: @color-gray91;
@autocomplete-item-amount__color: @color-gray60;
//    Common
//--------------------------------------
.xu{
    background: red;
}
@media only screen and (max-width: 450px) {

    .block-search {
        margin-bottom: 0;

        .control {
            /*border-top: 1px solid @border-color__base;*/
            clear: both;
            margin: 0px -313px -1px;;
            padding: 0 @layout__width-xs-indent;
            z-index: 81;
            width: 100%;
            position: fixed;
            background: #ffffff;
        }
    }

}
@media only screen and (max-width: 376px) {

    .block-search {
        margin-bottom: 0;
        .control {
            /*border-top: 1px solid @border-color__base;*/
            clear: both;
            margin: 0px -285px -1px;;
            padding: 0 @layout__width-xs-indent;
            z-index: 81;
            width: 100%;
            position: fixed;
            background: #ffffff;
        }
    }
}

& when (@media-common = true) {
    .block-search {
        margin-bottom: 0;
        .block {
            &-title {
                display: none;
            }
        }
        .block-content {
            margin-bottom: 0;
        }
        .label {
  /*          position: absolute;
            right: 60px;
            top: 0px;*/
            .lib-icon-font(
            @_icon-font-content: @icon-search,
                @_icon-font-size: 22px,
                @_icon-font-line-height: 28px,
                @_icon-font-margin: 0 @indent__s 0 0,
                @_icon-font-color: @minicart-icons-color,
                @_icon-font-color-hover: @minicart-icons-color-hover,
                @_icon-font-color-active: @minicart-icons-color-hover,
                @_icon-font-text-hide: true
                );
            display: inline-block;
         /*   float: right;*/
            &.active {
                + .control {
                    input {
                        position: static;
                    }
                }
            }
        }
        .action.search {
        //    display: none;
        }
        input {
            left: -300%;
            position: absolute;
            margin: 10px 0;
            background: #ffffff;
            border: 2px solid #9b9498;
            height: 40px;
            font-size: 15px;

            box-shadow: 0 4px 6px 0 rgba(0,0,0,.35);
        }
        input:not([disabled]):focus{
            box-shadow: 0 4px 6px 0 rgba(0,0,0,.35);

        }
        .nested {
            display: none;
        }
    }

    .search-autocomplete {
        display: none;
        position: absolute;
        z-index: 3;
        overflow: hidden;
        margin-top: -15px;
        &:extend(.abs-add-box-sizing all);
        ul {
            .lib-list-reset-styles();
            &:not(:empty) {
                .lib-css(background, @autocomplete-background);
                .lib-css(border, @autocomplete-border);
                border-top: 0;
            }
            li {
                .lib-css(border-top, @autocomplete-item-border);
                cursor: pointer;
                padding: @indent__xs @indent__xl @indent__xs @indent__s;
                margin: 0;
                position: relative;
                text-align: left;
                white-space: normal;
                &:first-child {
                    border-top: none;
                }
                &:hover,
                    &.selected {
                    .lib-css(background, @autocomplete-item-hover);
                }
                .amount {
                    .lib-css(color, @autocomplete-item-amount-color);
                    position: absolute;
                    right: 7px;
                    top: @indent__xs;
                }
            }
        }
    }

    .form.search.advanced {
        &:extend(.abs-forms-general-desktop all);
        .fields.range {
            .field {
                &:first-child {
                    position: relative;
                    .control {
                        padding-right: 25px;
                        &:after {
                            content: ' \2013 ';
                            display: inline-block;
                            text-align: center;
                            width: 25px;
                            position: absolute;
                            right: 0;
                            top: 6px;
                        }
                    }
                }
                &:last-child {
                    position: relative;
                    div.mage-error[generated] {
                        position: absolute;
                        top: 32px;
                        left: 0;
                    }
                }
                &.with-addon {
                    .control {
                        padding-right: 45px;
                    }
                }
                &.date {
                    &:extend(.abs-field-date all);
                }
            }
        }
        .group.price {
            .addon {
                .addafter {
                    background: none;
                    border: 0;
                    padding-top: 6px;
                    position: absolute;
                    right: 0;
                    top: 0;
                }
            }
        }
    }

    .search-terms {
        &:extend(.abs-reset-list all);
        line-height: 2em;
        > li {
            display: inline-block;
            margin-right: @indent__s;
        }
    }

}

//
//    Mobile
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .block-search {
        margin-top: 0px;

    }
}

//
//    Desktop
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .block-search {
        /*        position: relative;
                float: right;*/
        padding: 9px 0 9px 15px;
        width: 410px;
        z-index: 4;
        position: absolute;
        right: 140px;
        top:24px;
        .label {
            &:extend(.abs-visually-hidden-desktop all);
            position:initial;
            overflow:initial
        }
        .label:before{
            font-size:17px;
        }
        .control {
            border-top: 0;
            margin: 0;
            padding: 0;
        }
        .block-content{
            position:relative;
        }
        input {
            position: absolute;
            left:-800%;           
            padding-right: 40px;
            margin: 0;
            height: 40px;
            background: #fff;
            color: #000;

            border-color: @cpanel-border-color-dark-black;
            .lib-input-placeholder(@form-element-input-placeholder__color);
        }        
        .action.search {
            position: absolute;
            display: inline-block;
            right: -21px;
            width: 40px;
            top: -9px;

            z-index: 1;
            .lib-button-icon(
            @_icon-font-content: @icon-search,
                @_icon-font-size: 16px,
                @_icon-font-text-hide: true,
                @_icon-font-color: @cpanel-txt-color-white,
                @_icon-font-color-hover: @header-icons-color-hover,
                @_icon-font-line-height: 40px
                );
            .lib-button-reset();
            &:focus {
                &:before {
                    .lib-css(color, @color-gray20);
                }
            }
            &:before{
                color:#fff;
            }
        }
        .label{
            &.active {
                + .control {
                    input {
                        position: absolute;
                        left: inherit;
                        right: -20px;
                        top: -8px;
                        border-color: #e6e6e6;
                    }
                }
            } 
        }
    }
    .search-autocomplete {
        margin-top: 0;
    }
}

@media only screen and (max-width: 767px) {
    .block-search .label:before {
        margin: 3px 0px 0 0;
        content:'';
        width:44px;
        height:42px;
        background:url('../images/search.png') no-repeat;        
    }
    .block-search {
        .actions{
            z-index: 100;
            position: absolute;
            top: 60px;
            right: 10px;
        }
         .action.search {
            /*display: none;*/
            font-size: 0px;
            background: none;
            border: none;
            opacity: 1;
            font-size:0px;
            display:block !important;
            &:before{
                -webkit-font-smoothing: antialiased;
                font-size: 20px;
                line-height: 34px;
                color: #938c90;
                content: '\e615';
                font-family: 'luma-icons';
                vertical-align: middle;
                display: inline-block;
                font-weight: 100;
                overflow: hidden;
                speak: none;
                text-align: center;
            }
        }
    }
}
@media screen and (max-width: 499px){
    .block-search .label:before {
        background-size: 70%;
       /*  margin-top: 10px;  */       
    }
}
@media screen and (max-width: 399px){
    .block-search .label:before {
        width: 42px;
        height: 42px; 

    }
    .block-search .actions{
        position: absolute;
        top: 60px;
        display: block;
        right: 10px;
        color: #e40082;
        z-index: 100;
    }
}